package com.iot.web.controller.system;


import com.iot.common.core.domain.AjaxResult;
import com.iot.common.core.domain.entity.SysDept;
import com.iot.common.utils.MessageUtils;
import com.iot.system.core.CoreSystemHomeService;
import com.iot.system.domain.vo.DeviceDataCollectionVolumeVo;
import com.iot.system.domain.vo.DeviceTotalVo;
import com.iot.system.service.ISysDeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.iot.common.core.domain.AjaxResult.success;

@RestController
@RequestMapping("/system/home")
@Slf4j
public class SysHomeController {

    @Autowired
    private CoreSystemHomeService coreSystemHomeService;

    @GetMapping("/data")
    public AjaxResult data()
    {
        DeviceTotalVo deviceTotalVo = coreSystemHomeService.getDeviceAccessTotal();
        return success(deviceTotalVo);
    }

    @GetMapping("/dataCollectionVolume")
    public AjaxResult dataCollectionVolume()
    {
        DeviceDataCollectionVolumeVo dataCollectionVolume = coreSystemHomeService.dataCollectionVolume();
        return success(dataCollectionVolume);
    }
}
